const https = require("https");

// http.request()可以用于任意的请求方式
// https://www.taobao.com/
https
  .request(
    {
      hostname: "www.taobao.com",
      path: "",
      port: null,
      method: "GET",
    },
    (res) => {
      let result;
      res.on("data", (chunk) => {
        result += chunk;
      }),
        res.on("end", () => {
          console.log(result);
        });
    }
  )
  .end();
